package org.geektimes.projects.user.validator;

import org.geektimes.projects.user.domain.User;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @Author: jipeng
 * @Description:
 * @Date: Created in 2021/3/11 15:43
 */
public class UserValidAnnotationValidator implements ConstraintValidator<UserValid,User> {


    private int idRange;


    @Override
    public void initialize(UserValid constraintAnnotation) {
        idRange = constraintAnnotation.idRange();

    }


    @Override
    public boolean isValid(User user, ConstraintValidatorContext context) {
        // 获取模板信息
        context.getDefaultConstraintMessageTemplate();

        return false;
    }
}
